package com.hgzy.meeting.service;

import com.hgzy.meeting.mapper.DepartMentMapper;
import com.hgzy.meeting.model.DepartMent;
import com.hgzy.meeting.model.Employee;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DepartMentService {
    @Autowired
    private DepartMentMapper departMentMapper;

    /**
     * 根据id 查询到员工 employee
     * @param id
     * @return
     */
    public DepartMent findById(int id) {
        return departMentMapper.findById(id);
    }

    /**
     * 查询所有用户
     * @return
     */
    public List<DepartMent> findAllDeps() {
        return departMentMapper.findAllDeps();
    }


    public Integer addDepartment(String departmentname) {
        return departMentMapper.addDepartment(departmentname);
    }

    public Integer deleteDepartment(String departmentname) {
        return departMentMapper.deleteDepartment(departmentname);
    }

    public DepartMent findDepartment(String departmentname) {
        return departMentMapper.findDepartment(departmentname);
    }
}
